; Additional fixup for truncation of long lines in compilation buffers
authorPhil Sainty <psainty@orcon.net.nz>
Sat, 13 Apr 2024 12:49:56 +0000 (00:49 +1200)
committerPhil Sainty <psainty@orcon.net.nz>
Sat, 13 Apr 2024 13:00:05 +0000 (01:00 +1200)
* lisp/progmodes/compile.el
(compilation--insert-abbreviated-line): Handle long lines that end
in a newline.  (Bug#70236)

The fix in commit 8f93cba324e4d4022a9422b8c56186213ba2de8d resulted in
the previous "Don't hide the final newline" code causing an off-by-one
error.  With the new code the value of point is what is wanted in both
cases.

lisp/progmodes/compile.el

index d7690b7fa74803b617c56e3ca5b4835d18fbf9dc..b18eb81fee144a1fd0a32de89419a13b18f812c1 100644 (file)
@@ -2661,10 +2661,7 @@ and runs `compilation-filter-hook'."
                                                (line-end-position))
                                        (text-properties-at start)))))
           (put-text-property
-           start (if ends-in-nl
-                     ;; Don't hide the final newline.
-                     (1- (point))
-                   (point))
+           start (point)
            'display (if (char-displayable-p ?…) "[…]" "[...]"))))
       (if ends-in-nl (forward-char)))))